package com.demo.zookeeper;

import java.io.IOException;

import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.ZooKeeper;

public class ZKSetData {
	
	private static ZooKeeper zk;

	public static void main(String[] args) throws IOException, InterruptedException, KeeperException {
		final String path = "/dataNode";
		byte[] data = "Success".getBytes();
		zk = ZookeeperConnection.connect();
		zk.setData(path, data, zk.exists(path, true).getVersion());
		ZookeeperConnection.close();
	}

}
